import request from '@/utils/request'

export default {
  //1.添加课程信息
  addCourseInfo(courseInfo){
    return request({
      url:`/admin/edu/course/addCourseInfo`,
      method:'post',
      data:courseInfo
    })
  },
  //查询所有讲师
  getTeacherList(){
    return request({
      url:`/admin/edu/teacher/findAll`,
      method:'get'
    })
  },
  //根据id查找课程信息
  getCourseInfo(id){
    return request({
      url:`/admin/edu/course/getCourseInfo/`+id,
      method:'get'
    })
  },
  //更新课程信息
  updateCourseInfo(courseInfo){
    return request({
      url:`/admin/edu/course/updateCourseInfo`,
      method:'post',
      data:courseInfo
    })
  },
  //查询最终发布显示信息
  getCoursePublishVo(id){
    return request({
      url:`/admin/edu/course/getCoursePublish/${id}`,
      method:'get'
    })
  },
  //发布课程
  publishCourse(id){
    return request({
      url:`/admin/edu/course/publishCourse/${id}`,
      method:'post'
    })
  },
  //查所有课程
  getList(current,limit,courseQuery) {
    return request({
      url: `/admin/edu/course/list/${current}/${limit}`,
      method: 'get',
      params:courseQuery
    })
  },
  //删除课程
  deleteCourse(id){
    return request({
      url: `/admin/edu/course/${id}`,
      method: 'delete'
    })
  }
  }
